<?php
session_start();
/*
 * Session variables:
 * $_SESSION['type'] [string] = user type of the logged in user
 * $_SESSION['authorised'] [boolean] = whether or not the current user is logged in
 */

if (isset($_SESSION['authorised']) && $_SESSION['authorised'] == true) {
    if (isset($_SESSION['type'])) {
        if ($_SESSION['type'] == 'administrator') {
?>
            <html xmlns="http://www.w3.org/1999/xhtml">
                <head>
                    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                    <title>Tutor Account Creation</title>
                    <link href="StyleSheet.css" rel="stylesheet" type="text/css" />
                    <style>
                        .nav {
                            width:210px;
                            height:auto;
                            border:thin solid #09C;

                            margin-left: 10px;
                            text-align : center;}

                        .mainline {
                            width:712px;

                            height:auto;
                            text-align : center;}
                        </style>
						
						<script>
	function setOptions(chosen) 
	{
		var selbox = document.myform.day;
		selbox.options.length = 0;
		
		if (chosen == "Jan" || chosen == "Mar" || chosen == "May" || chosen == "Jul" || chosen == "Aug" || chosen == "Oct" || chosen == "Dec")
		{
		  <?php 
		  for($i=1; $i < 32; $i++)
		  {
		  	print ("selbox.options[selbox.options.length] = new Option($i,$i);\n");
		  }
		  ?>
		}
		else if (chosen == "Feb")
		{
		  <?php 
		  for($i=1; $i < 29; $i++)
		  {
		  	print ("selbox.options[selbox.options.length] = new Option($i,$i);\n");
		  }
		  ?>
		}
		else
		{
		  <?php 
		  for($i=1; $i < 31; $i++)
		  {
		  	print ("selbox.options[selbox.options.length] = new Option($i,$i);\n");
		  }
		  ?>
		}
		
		
	}
			</script>
			
                    </head>

                    <center>
                        <body bgcolor="#FFFFFF">
                            <div id="wrapper">
                            <div id="header">
                                <h1></h1>
                            </div>
                            <div id="header2">
                                <h3></h3>
                            </div>

                            <div id="nav">
                                <?php include 'admin_navigation.php';?>
                            </div>
                            <div id="mainline">
                                <h4> Create Tutor Account </h4>
                                <div id="body">                                    
                                    <form name = "myform" action="admin_create_tutor_submit.php" method="post">
                                        <table width="712" cellpadding="2" class="infotable" align="left">
                                           <tr align="left">
                                                <th height="42" scope="row">In Case of an Emergency</th>
                                                </tr>
                                                 <tr align="left">
                                                <th height="42" scope="row">Contact Person:</th>
                                                <td>
                                                    <input type="text" size="50" maxlength="100" id="contact_person" name="contact_person"/>
                                                </td>
                                            </tr>
											<tr align="left">
                                                <th height="42" scope="row">Person's Contact Number:</th>
                                                <td>
                                                    <input type="text" size="50" maxlength="100" id="contact_number" name="contact_number"/>
                                                </td>
                                            </tr>
                                            <tr></tr>
											<tr align="left">
                                                <th height="42" scope="row">Educational Attainment:</th>
                                                <td>
                                                    <input type="text" size="50" maxlength="100" id="educ_attainment" name="educ_attainment"/>
                                                </td>
                                            </tr>
                                            
                                            <tr align="left">
                                                <td></td>
                                                <td><input type = "submit" value ="Submit" /></td>
                                            </tr>
                                        </table>
                                    </form>
                                </div>
                            </div>



                            <p align="justify"><br /></p>
                      

                        <br class="clearfloat"/>
                        <br />

                        <div id="footer">
                            <p align="center">
                                Tutorial Business Manager: info@tbms.com <br />Credits/Engineers: Aquino, Chloebelle; Dela Cruz, Roy Erwin; Maliwanag, Ranyel Bryan; Manzano, Audrey Ann; Ng, Sheila Regine<br />
                                <br />copyright 2011</p>
                        </div>
                          </div>
                    </body>
                </center>
            </html>
<?php
        }
        elseif ($_SESSION['type'] == 'student') 
        {
            header('Location: student_index.php');
            exit();
        } elseif ($_SESSION['type'] == 'tutor') {
            header('Location: tutor_index.php');
            exit();
        } elseif ($_SESSION['type'] == 'parent') {
            header('Location: parent_index.php');
            exit();
        }
    }
} else {
    header('Location: index.php');
}
?>
